package cc.realxyq.demo.config.aop;

import cc.realxyq.demo.aop.Calculator;
import cc.realxyq.demo.aop.LogAspect;
import cc.realxyq.demo.aop.LogAspect2;
import cc.realxyq.demo.aop.MyBeanPostProcessor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;

/**
 * @author kwhan
 * @date 2022年01月10日 13:37
 */
@Slf4j
@Configuration
@Import(MyBeanPostProcessor.class)
@EnableAspectJAutoProxy
public class LogAspectConfig {

    @Bean(initMethod = "init",destroyMethod = "close")
    public Calculator calculator() {
        return new Calculator();
    }

    @Bean
    public LogAspect2 logAspect2() {
        return new LogAspect2();
    }

    @Bean
    public LogAspect logAspect() {
        return new LogAspect();
    }


}
